# run_server.py
import logging
from waitress import serve
from app import app

# 配置日志记录
default_handler = logging.StreamHandler()
app.logger.addHandler(default_handler)

try:
    app.logger.info('正在启动服务器...')
    serve(app, host='0.0.0.0', port=8000)  # 改为使用 8000 端口
except Exception as e:
    app.logger.error(f'启动服务器失败: {str(e)}')